class AdminController < PrivateController

  before_filter :must_be_admin

  def migrate
    if params[:xml_file].present?
      start = Time.now
      @count = Hour.populate_data(params[:xml_file].read)
      @time = Time.now - start
    end
  end

  protected

  def must_be_admin
    render :file => "#{RAILS_ROOT}/public/403.html", :layout => false, :status => 403 unless current_user.is_administrator?
  end

  private

  def model_name
    'user'
  end

end
